<?php
include("../config.php");
$uid = $_GET['uid'];
$uid = str_ireplace($search, '', $uid);

$sql = "select danwei from user where openid='$uid'";
$requ = mysqli_query($con,$sql);
$rs = mysqli_fetch_array($requ);
$dwid = $rs['danwei'];

$sql = "select other from danwei where id=$dwid";
$requ = mysqli_query($con,$sql);
$rs = mysqli_fetch_array($requ);
$dw = $rs['other'];

$sql = "select id,name from danwei where status=1 and other='$dw'";
$requ = mysqli_query($con,$sql);
$d='[';
while($rs = mysqli_fetch_array($requ)){
	$d.='{"value":"'.$rs['id'].'","label":"'.$rs['name'].'"},';
}
$d = rtrim($d,',');
$d.=']';
$result='{"status":"1","msg":"ok","data":'.$d.'}';

echo $result;










